'''
验证码处理的处理方式：
    注释验证码（建议）
    万能码（建议）
    调用图片识别插件
    添加 cookie ，绕过验证
'''

from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
from options import options

driver = webdriver.Chrome(options=options)
driver.get(r'https://www.baidu.com/')
driver.maximize_window()
sleep(5)

# 百度网站：BAIDUID 和 BDUSS

cookie1 = {'name': 'BAIDUID', 'value': '717C226512C2AC8A757206E2A231A145'}
cookie2 = {'name': 'BDUSS',
           'value': 'NTQjBiaW5RdHRQd1Jwb1JEOXFpV0Vsa0dFWUd5Vnk1WFk3SG9pT3YwaDJtcnhsRVFBQUFBJCQAAAAAAAAAAAEAAABm-CsCbHVhbnhpYW9tZWkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHYNlWV2DZVld0'}
driver.add_cookie(cookie1)
driver.add_cookie(cookie2)
driver.refresh()
sleep(5)
driver.quit()










